php 数据库 生成表 – 青春部落,流年似水 http://www.youthtribe.com 青春是一场远行,总记不起来时的路。 Sat, 11 Feb 2012 03:49:55 +0000 zh-CN hourly 1 https://wordpress.org/?v=6.1.7 php 数据库 生成表 – 青春部落,流年似水 http://www.youthtribe.com/archives/431 http://www.youthtribe.com/archives/431#respond Sat, 11 Feb 2012 03:49:31 +0000 http://www.youthtribe.com/?p=431 由于原来的淘宝客程序没有一个展示正经内容的数据表,今天来做一下。这样一来也可以在首页展示更多内容相关的关键词。关键是加上火车头采集,再来自动内容更新,只要找一个常有文章更新的网站就行啦。ok,here we go。

首先要来一个建表的php,直接上代码:

<?php
require(‘../configs/config.php’);
######2012-02-11

$sql_cre_article_good=mysql_query(“CREATE TABLE IF NOT EXISTS `article_good` (
`id` int(100) NOT NULL auto_increment,
`title` varchar(200) CHARACTER SET utf-8 COLLATE utf-8_chinese_ci NOT NULL,
`keyword` varchar(200) CHARACTER SET utf-8 COLLATE utf-8_chinese_ci NOT NULL,
`description` varchar(500) CHARACTER SET utf-8 COLLATE utf-8_chinese_ci NOT NULL,

`article` varchar(20) CHARACTER SET utf-8 COLLATE utf-8_chinese_ci NOT NULL,
`addtime` datetime NOT NULL,

PRIMARY KEY (`id`)
)”);

if($sql_cre_article_good) echo “文章表-article_good-创建成功!”.”<br>”;

else echo “文章表-article_good-创建失败或已存在,请查看!”;

###########

?>

前台显示不难,就不絮叨了。呵

]]>
http://www.youthtribe.com/archives/431/feed 0